﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.db2
{
	// Token: 0x020001ED RID: 493
	public class TDb2WhileStmt : TBlockSqlStatement
	{
		// Token: 0x0600109D RID: 4253 RVA: 0x0030D193 File Offset: 0x0030B393
		public TDb2WhileStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstdb2whilestmt;
		}

		// Token: 0x0600109E RID: 4254 RVA: 0x0030D1A7 File Offset: 0x0030B3A7
		internal override void buildsql()
		{
		}

		// Token: 0x0600109F RID: 4255 RVA: 0x0030D1A9 File Offset: 0x0030B3A9
		internal override void clear()
		{
		}

		// Token: 0x060010A0 RID: 4256 RVA: 0x0030D1AB File Offset: 0x0030B3AB
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x060010A1 RID: 4257 RVA: 0x0030D1B2 File Offset: 0x0030B3B2
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x060010A2 RID: 4258 RVA: 0x0030D1B4 File Offset: 0x0030B3B4
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TWhileSqlNode twhileSqlNode = (TWhileSqlNode)this.rootNode;
			base.doParseStatement(psql);
			this.condition = twhileSqlNode.Condition;
			twhileSqlNode.Stmts.doParse(this, ESqlClause.unknown);
			for (int i = 0; i < twhileSqlNode.Stmts.size(); i++)
			{
				this.BodyStatements.add(twhileSqlNode.Stmts.getStatementSqlNode(i).Stmt);
			}
			return 0;
		}

		// Token: 0x17000309 RID: 777
		// (get) Token: 0x060010A3 RID: 4259 RVA: 0x0030D22B File Offset: 0x0030B42B
		// (set) Token: 0x060010A4 RID: 4260 RVA: 0x0030D233 File Offset: 0x0030B433
		public virtual TExpression Condition
		{
			get
			{
				return this.condition;
			}
			set
			{
				this.condition = value;
			}
		}

		// Token: 0x060010A5 RID: 4261 RVA: 0x0030D23C File Offset: 0x0030B43C
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060010A6 RID: 4262 RVA: 0x0030D24C File Offset: 0x0030B44C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.condition.accept(v);
			this.BodyStatements.accept(v);
			v.postVisit(this);
		}

		// Token: 0x04001398 RID: 5016
		private TExpression condition;
	}
}
